home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib10.dsk
/
APPLE ART GALLERY.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
20KB
|
565 lines
2 REM *******************************
3 REM * APPLE ART GALLERY *
4 REM * BY EDGAR J. YOUNG *
5 REM * COPYRIGHT (C) 1982 *
6 REM * BY MICRO-SPARC INC *
7 REM * LINCOLN, MA. 01773 *
8 REM * ALL RIGHTS RESERVED *
9 REM *******************************
35 LOMEM: 24576
40 HGR2 : TEXT : HOME : VTAB 7: HTAB 9: PRINT " APPLE ART GALLERY": PRINT : PRINT
50 HTAB 9: PRINT "COPYRIGHT (C) 1982": PRINT : PRINT
60 HTAB 9: PRINT "BY MICRO-SPARC, INC."
80 GOSUB 320: REM VARIABLE INITIALIZATION
90 VTAB 23: HTAB 6: PRINT "PRESS SPACE BAR TO CONTINUE..."
92 POKE -16368,0
94 A = RND(1): IF PEEK( -16384) <128 GOTO 94: REM RANDOMIZES RND(I)
100 REM INSTRUCTIONS
110 TEXT : HOME : PRINT
120 PRINT " THIS PROGRAM RANDOMLY DISPLAYS A"
130 PRINT "VARIETY OF GRAPHIC ART FORMS. TO"
140 PRINT "CONTROL IT, USE THE FOLLOWING SINGLE"
150 PRINT "KEY INSTRUCTIONS AT ANY TIME:"
160 PRINT : PRINT " I - DISPLAY THESE 'INSTRUCTIONS'"
170 PRINT : PRINT " H - 'HOLD' THIS PICTURE UNTIL <H>"
180 HTAB 8: PRINT "IS PRESSED AGAIN"
190 PRINT : PRINT " S - 'SEQUENTIALLY' RUN ALL ART FORMS"
200 PRINT : PRINT " R - 'RUN' ONE ART FORM CONTINUOUSLY"
210 HTAB 8: PRINT "UNTIL THE SPACE BAR IS PRESSED"
220 PRINT : PRINT " N - START OR STOP 'NUMBERING'"
230 HTAB 8: PRINT "THE ART FORMS"
240 PRINT : PRINT " SPACE BAR - CONTINUE RANDOM DISPLAYS"
250 PRINT : PRINT " ESC - ESCAPE THIS PROGRAM"
260 CALL 62450: REM CLEAR HGR2 SCREEN
265 POKE -16368,0
270 PRINT : HTAB 20: PRINT "YOUR COMMAND? ";: GET A$:A = ASC(A$)
280 IF A = A1 OR A = A2 GOTO 100
290 IF A = A5 THEN FL = 1: GOTO 670
300 GOSUB 520
310 GOTO 100
320 REM CONSTANTS AND DIMENSIONS
400 PI = 3.141592654:CX = 140:CY = 95:RM = 90:RP = 45
410 A1 = 73:A2 = 72:A3 = 83:A4 = 82:A5 = 78:A6 = 32:A7 = 27
420 FL = 0:FS = 0:FR = 0:P = 0
430 CS = 0:CG = 0
440 PK = -16384
450 NF = 33
460 C$ = "":C1$ = ""
470 DIM P(4,150,2): REM
480 RETURN
490 REM PROGRAM CONTROL
500 IF PEEK(PK) <128 THEN RETURN
510 GET A$:A = ASC(A$)
520 IF A < >A1 AND A < >A2 AND A < >A3 AND A < >A4 AND A < >A5 AND A < >A6 AND A < >A7 THEN RETURN
530 IF A = A1 THEN CALL 54915:FS = 0:FR = 0: GOTO 100
540 REM CALL 54915 RESETS THE GOSUB STACK TO ZERO WITHOUT AFFECTING ANYTHING ELSE
550 IF A = A2 THEN GET A$: RETURN
560 IF A = A3 GOTO 640
570 IF A = A4 GOTO 610
580 IF A = A5 THEN FL = ABS(FL -1): RETURN
590 IF A = A6 THEN CALL 54915:FS = 0:FR = 0: GOTO 670
600 TEXT : HOME : END
610 CALL 54915
620 FS = 0
630 FR = 1: TEXT : HOME : VTAB 10: PRINT " SELECT THE ART FORM (1 TO ";NF;") THAT YOUWANT TO RUN CONTINUOUSLY.": GOTO 800
640 CALL 54915
650 FR = 0
660 FS = 1: TEXT : HOME : VTAB 10: PRINT " SELECT THE ART FORM (1 TO ";NF;") THAT YOUWANT TO START THE SEQUENCE FROM.": GOTO 800
670 REM ART FORM SELECTION
680 IF FR = 1 GOTO 710
690 IF FS = 1 THEN NN = NN +1: IF NN = NF +1 THEN NN = 1
700 IF FS < >1 THEN NN = INT( RND(1) *NF +1)
710 ON INT(NN/10 +1) GOTO 720,740,760,780
720 ON NN GOSUB 4990,3320,2950,1070,1290,1700,3850,4060,3320
730 GOTO 670
740 ON NN -9 GOSUB 1060,1300,1400,2600,3330,4320,1980,1690,1080,3340
750 GOTO 670
760 ON NN -19 GOSUB 2320,3800,1280,3340,1500,1050,1710,3330,1970,1300
770 GOTO 670
780 ON NN -29 GOSUB 3400,1040,3760,3450
790 GOTO 670
800 REM ART FORM NUMBER INPUT
810 PRINT : PRINT " PRESS <RETURN> WHEN YOU HAVE TYPED IN YOUR ENTRY...";
820 IX = POS(0) +1
830 GET A$:C = ASC(A$): IF C <49 OR C >57 THEN HTAB IX: GOTO 830
840 C1$ = A$:C$ = A$: PRINT A$;:X = POS(0) +1
850 GET A$:C = ASC(A$): IF C = 13 GOTO 920
860 IF C = 8 THEN X = POS(0): HTAB X: PRINT " ";: HTAB X: GOTO 830
870 IF C <48 OR C >57 THEN HTAB X: GOTO 850
880 C$ = C1$ +A$: PRINT A$;:X = POS(0) +1
890 GET A$:C = ASC(A$): IF C = 13 GOTO 920
900 IF C = 8 THEN X = POS(0): HTAB X: PRINT " ";: HTAB X:C$ = C1$: GOTO 850
910 GOTO 890
920 NN = VAL(C$): IF NN <1 OR NF <NN THEN HTAB IX: PRINT " ";: HTAB IX: GOTO 830
930 IF FS = 1 THEN NN = NN -1
935 HOME : VTAB 10: HTAB 14: PRINT "I'M THINKING"
940 GOTO 670
950 REM ART FORM NUMBERING SUBROUTINE
960 IF FL = 1 GOTO 980
970 GOTO 1010
980 TEXT : HOME : VTAB 10: HTAB 13: PRINT "ART FORM # ";NN
990 CALL 62450: FOR DE = 1 TO 100: GOSUB 500: NEXT DE
1000 REM CHOOSE SCREEN COLOR - WHITE ON BLACK OR BLACK ON WHITE
1010 IF RND(1) -.5 >0 THEN HGR2 : HCOLOR= 7:CS = 4: RETURN
1020 HCOLOR= 7: HGR2 : HPLOT CX,CY: CALL 62454: HCOLOR= 4:CS = 7: RETURN
1030 REM ART FORMS 31,25,10,4,18
1040 FOR DE = 1 TO 200: GOSUB 500: NEXT DE:P = INT( RND(1) *11 +10): GOTO 1100
1050 P = INT( RND(1) *21 +90): GOTO 1100
1060 P = INT( RND(1) *51 +20): GOTO 1100
1070 P = INT(( RND(1) *21 +20)/2) *2: GOTO 1100
1080 P = INT( RND(1) *61 +20)
1090 REM DEFINE POINTS AROUND A CIRCLE
1100 I = 1:AN = 2 *PI/P
1110 P(1,1,1) = CX:P(1,1,2) = CY -RM:K = P
1120 FOR J = 2 TO INT(P/2 +1):PX = RM * SIN((J -1) *AN):P(I,J,1) = CX +PX:P(I,K,1) = CX -PX:P(I,J,2) = CY -RM * COS((J -1) *AN):P(I,K,2) = P(I,J,2):K = K -1: GOSUB 500: NEXT J
1130 GOSUB 950
1140 REM GRAPH ROUTINE
1150 IF NN < >31 GOTO 1180
1160 FOR J = 1 TO P -1: FOR K = J +1 TO P: GOSUB 1260: NEXT K,J
1170 RETURN
1180 J = 1: IF NN = 18 THEN J = INT( RND(1) *P +1)
1190 FOR K = 1 TO P: GOSUB 1260: NEXT K: IF NN = 25 THEN RETURN
1200 IF NN = 4 OR NN = 18 GOTO 1230
1210 J = 2: FOR K = 3 TO P: GOSUB 1260: NEXT K
1220 J = P: FOR K = 1 TO P: GOSUB 1260: NEXT K: RETURN
1230 IF NN = 18 GOTO 1250
1240 J = P/2 +1: FOR K = 1 TO P: GOSUB 1260: NEXT K: RETURN
1250 J = INT( RND(1) *P +1): FOR K = 1 TO P: GOSUB 1260: NEXT K: RETURN
1260 HPLOT P(I,J,1),P(I,J,2) TO P(I,K,1),P(I,K,2): GOSUB 500: RETURN
1270 REM ART FORMS 22,5,11
1280 P = INT( RND(1) *8 +5):C = P: GOTO 1330
1290 P = INT( RND(1) *9 +3):C = INT( RND(1) *21 +30): GOTO 1330
1300 P = 33
1310 IF NN = 11 THEN C = INT( RND(1) *8 +5)
1320 IF NN = 29 THEN C = INT( RND(1) *11 +20)
1330 FOR DE = 1 TO 200: GOSUB 500: NEXT DE
1340 AN = 2 *PI/P: FOR I = 1 TO P:P(1,I,1) = RP * SIN(AN *I):P(1,I,2) = RP * COS(AN *I): GOSUB 500: NEXT I
1350 GOSUB 950
1360 REM GRAPH ROUTINE
1370 FOR I = 1 TO C:PY = CY -RP * COS(I *2 *PI/C):PX = CX +RP * SIN(I *2 *PI/C): HPLOT PX,PY -RP
1380 FOR A = 1 TO P: HPLOT TO PX +P(1,A,1),PY -P(1,A,2): NEXT A: GOSUB 500: NEXT I: RETURN
1390 REM ART FORM 12
1400 P = INT( RND(1) *25 +6)
1410 FOR DE = 1 TO 200: GOSUB 500: NEXT
1420 IX = 130/P:IY = 90/P:X = 140:Y = 95:PX = 130:PY = 0
1430 GOSUB 950
1440 REM GRAPH ROUTINE
1450 GC = 2
1460 FOR I = 1 TO P +1
1470 HPLOT X,Y +PY TO X +PX,Y TO X,Y -PY TO X -PX,Y TO X,Y +PY: GOSUB 500
1480 PX = PX -IX:PY = PY +IY: NEXT I: RETURN
1490 REM ART FORM 24
1500 FOR DE = 1 TO 300: GOSUB 500: NEXT DE
1510 X = INT( RND(1) *180):Y = INT( RND(1) *192)
1520 GOSUB 2740: GOSUB 950
1530 REM GRAPH ROUTINE
1540 HPLOT X,Y
1550 FOR I = 1 TO 300
1560 L = INT( RND(1) *RM -RP)
1570 IX = 0:IY = 0: IF SGN( RND(1) -.5) >0 THEN IX = L: GOTO 1590
1580 IY = L
1590 X = X +IX:Y = Y +IY
1600 IF X >279 THEN X = X -10: GOTO 1600
1610 IF X <0 THEN X = X +10: GOTO 1610
1620 IF Y >191 THEN Y = Y -10: GOTO 1620
1630 IF Y <0 THEN Y = Y +10: GOTO 1630
1640 HPLOT TO X,Y
1650 POKE 6, INT((X +Y)/2): POKE 7, INT( RND(1) *4 +1): CALL 768
1660 GOSUB 500
1670 NEXT I: RETURN
1680 REM ART FORM 17,6,26
1690 P = INT( RND(1) *91 +10):PR = INT( RND(1) *51 +10):N = INT( RND(1) *4 +3): GOTO 1730
1700 P = INT( RND(1) *121 +30):PR = 100:N = 1: GOTO 1730
1710 N = INT( RND(1) *5 +2):R = 130
1720 P = INT( RND(1) *91 +10):PR = INT( RND(1) *51 +10): GOTO 1740
1730 R = 130
1740 IF PR = 100 THEN S = INT(P/2): GOTO 1770
1750 A = 1 -PR/100
1760 S = INT(( - ATN(A/ SQR( -A *A +1)) +1.5708) *P/PI +.5)
1770 I = 1:J = 1
1780 I = I +1:J = J +S: IF J >P THEN J = J -P
1790 IF I <P AND J = 1 AND P <150 THEN P = P +1: GOTO 1750
1800 GOSUB 500: IF I <P GOTO 1780
1810 AN = 2 *PI/P:IR = CY/CX *R:K = P:P(1,1,1) = CX:P(1,1,2) = CY -IR
1820 FOR I = 2 TO INT(P/2 +1)
1830 A = (I -1) *AN:PX = R * SIN(A):P(1,I,1) = CX +PX:P(1,K,1) = CX -PX:P(1,I,2) = CY -IR * COS(A):P(1,K,2) = P(1,I,2):K = K -1
1840 GOSUB 500: NEXT I
1850 IF R = 130 THEN GOSUB 950
1860 REM GRAPH ROUTINE
1870 J = 1: HPLOT P(1,J,1),P(1,J,2)
1880 FOR I = 1 TO P
1890 J = J +S: IF J >P THEN J = J -P
1900 HPLOT TO P(1,J,1),P(1,J,2)
1910 GOSUB 500: NEXT I
1920 R = R * COS(S *PI/P) -3
1930 N = N -1: IF N = 0 THEN RETURN
1940 IF NN = 26 GOTO 1720
1950 GOTO 1810
1960 REM ART FORMS 28 & 16
1970 PR = 1: GOTO 1990
1980 PR = -1: FOR DE = 1 TO 200: GOSUB 500: NEXT
1990 P = INT( RND(1) *12 +4):PR = PR *( RND(1) *.45 +.25)
2000 R = 90:PR = R *PR
2010 A = 0:SA = 0:CA = 0:J = 0
2020 FOR I = 1 TO 2 *P
2030 P(1,I,1) = CX +R * SIN((I -1)/P *PI)
2040 P(1,I,2) = CY -R * COS((I -1)/P *PI)
2050 I = I +1
2060 P(1,I,1) = CX +PR * SIN((I -1)/P *PI)
2070 P(1,I,2) = CY -PR * COS((I -1)/P *PI)
2080 GOSUB 500
2090 NEXT I
2100 GOSUB 950
2110 REM GRAPH ROUTINE
2120 FOR I = 1 TO 2 *P
2130 HPLOT CX,CY TO P(1,I,1),P(1,I,2)
2140 NEXT I
2150 HPLOT P(1,1,1),P(1,1,2)
2160 FOR I = 1 TO 2 *P
2170 HPLOT TO P(1,I,1),P(1,I,2)
2180 GOSUB 500
2190 NEXT I
2200 HPLOT TO P(1,1,1),P(1,1,2)
2210 IF PR <0 GOTO 2300
2220 FOR I = 1 TO 2 *P
2230 I = I +1
2240 A = (I -1)/P *PI:SA = SIN(A):CA = COS(A)
2250 FOR J = 1 TO PR
2260 HPLOT P(1,I -1,1),P(1,I -1,2) TO CX +J *SA,CY -J *CA
2270 GOSUB 500
2280 NEXT J
2290 NEXT I
2300 RETURN
2310 REM ART FORM 20
2320 L = INT( RND(1) *6 +4)
2330 C = INT( RND(1) *11 +5)
2340 N = RND(1)
2350 I = 1: GOSUB 2460
2360 FOR J = 1 TO L: FOR K = 1 TO 2:P(3,J,K) = P(1,J,K): NEXT K,J
2370 FOR DE = 1 TO 300: GOSUB 500: NEXT DE: GOSUB 950
2380 REM GRAPH ROUTINE
2390 FOR N = 2 TO C
2400 FOR J = 1 TO L: FOR K = 1 TO 2:P(2,J,K) = P(3,J,K): NEXT K,J
2410 I = 3: GOSUB 2460
2420 FOR M = 1 TO L: HPLOT P(2,M,1),P(2,M,2) TO P(3,M,1),P(3,M,2): NEXT M
2430 GOSUB 500: NEXT N
2440 FOR M = 1 TO L: HPLOT P(3,M,1),P(3,M,2) TO P(1,M,1),P(1,M,2): NEXT M
2450 RETURN
2460 REM POINT LOCATION
2470 X = 20 + RND(N) *239:Y = 20 + RND(N) *151
2480 A = RND(N) *2 *PI:CA = COS(A):SA = SIN(A)
2490 R = RND(N) *90
2500 IX = X +R *CA
2510 IY = Y +R *SA
2520 GOSUB 500
2530 IF IX <0 OR IX >279 OR IY <0 OR IY >191 THEN R = R -1: GOTO 2500
2540 FOR M = 1 TO L
2550 P(I,M,1) = X +R *M/L *CA
2560 P(I,M,2) = Y +R *M/L *SA
2570 NEXT M
2580 RETURN
2590 REM ART FORM 13
2600 FOR DE = 1 TO 300: GOSUB 500: NEXT DE
2610 GOSUB 2740
2620 GOSUB 950
2630 REM GRAPH ROUTINE
2640 Y = 191 * RND(1):X = 0
2650 HPLOT X,Y
2660 I = RND(1) *4 +1:X = X +I: IF X >279 GOTO 2720
2670 Y = 191 * RND(X)
2680 HPLOT TO X,Y
2690 POKE 6, INT(Y): POKE 7, INT(I): CALL 768
2700 GOSUB 500
2710 GOTO 2660
2720 RETURN
2730 REM 'BOOP' SOUND ROUTINE, POKE 6 AND 7 TO VARY PITCH AND DURATION
2740 POKE 768,173
2750 POKE 769,48
2760 POKE 770,192
2770 POKE 771,136
2780 POKE 772,208
2790 POKE 773,4
2800 POKE 774,198
2810 POKE 775,7
2820 POKE 776,240
2830 POKE 777,8
2840 POKE 778,202
2850 POKE 779,208
2860 POKE 780,246
2870 POKE 781,166
2880 POKE 782,6
2890 POKE 783,76
2900 POKE 784,0
2910 POKE 785,3
2920 POKE 786,96
2930 RETURN
2940 REM ART FORM 19
2950 FOR DE = 1 TO 300: GOSUB 500: NEXT DE: GOSUB 950
2960 REM GRAPH ROUTINE
2970 IX = 279:IY = 191:A = 100:R = 1:J = 1
2980 GOSUB 3090
2990 N = 50 -20 * RND(1)
3000 J = J +1: IF J >6 THEN RETURN
3010 FOR I = 1 TO N:P(1,I,1) = IX * RND(R):P(1,I,2) = IY * RND(R): NEXT
3020 POKE 783, INT( RND(R) *90 +A)
3030 C = INT( RND(R) *8): HCOLOR= C: IF (CS = 7 AND (C = 7 OR C = 3)) OR (CS = 4 AND (C = 0 OR C = 4)) GOTO 3030
3040 X = RND(R) *IX:Y = RND(R) *IY
3050 FOR I = 1 TO N: HPLOT X,Y TO P(1,I,1),P(1,I,2): CALL 768: NEXT
3060 GOSUB 500
3070 GOTO 2990
3080 REM LAZER SOUND ROUTINE, POKE 783 FOR TONE, POKE 769 FOR MULTIPLE TONES
3090 POKE 768,160
3100 POKE 769,1
3110 POKE 770,162
3120 POKE 771,0
3130 POKE 772,138
3140 POKE 773,24
3150 POKE 774,233
3160 POKE 775,1
3170 POKE 776,208
3180 POKE 777,252
3190 POKE 778,141
3200 POKE 779,48
3210 POKE 780,192
3220 POKE 781,232
3230 POKE 782,224
3240 POKE 784,208
3250 POKE 785,242
3260 POKE 786,136
3270 POKE 787,208
3280 POKE 788,237
3290 POKE 789,96
3300 RETURN
3310 REM ART FORMS 20-22
3320 RS = 0:EL = 1:SL = RND(1) *.5: GOTO 3350
3330 SL = RND(1) *.4 +.4:EL = SL:RS = RND(1) *(.8 -SL): GOTO 3350
3340 SL = RND(1):EL = RND(1):RS = (1 -SL) * RND(1) *.8: IF ABS(EL -SL) <.3 GOTO 3340
3350 NS = INT( RND(1) *8 +5)
3360 OV = INT( RND(1) *2 +1)
3370 NA = INT(( RND(1) *41 +120)/NS)
3380 NR = OV *NA/(( INT(NA/OV) *OV +1) *NS)
3390 GOTO 3540
3400 RS = RND(1) *.5:SL = RND(1) *.36 +.04:EL = SL
3410 NS = INT( RND(1) *6 +5)
3420 NR = (1 -EL -RS)/(NS *(SL +4/RM))
3430 NA = INT(NR *( RND(1) *41 +100))
3440 GOTO 3540
3450 IF RND(1) -.5 >0 THEN RS = 0: GOTO 3470
3460 RS = RND(1) *.2 +.1
3470 SL = RND(1) *.04 +.06
3480 IF RND(1) -.5 >0 THEN EL = SL: GOTO 3500
3490 EL = RND(1) *SL *.5
3500 NR = RND(1) *31 +20
3510 NA = INT( RND(1) *31 +40)
3520 NS = INT(500/NA)
3530 IF ABS(NR/NS - INT(NR/NS)) <.1 GOTO 3500
3540 FOR DE = 1 TO 200: GOSUB 500: NEXT DE: GOSUB 950
3550 REM GRAPH ROUTINE
3560 DI = SGN( RND(1) -.5)
3570 IA = 2 *PI *NR/NA *DI
3580 FOR I = 0 TO NS -1
3590 ISR = RM *(1 -EL -RS)/NA
3600 ILR = RM *(1 -RS -SL)/NA
3610 IF NN = 9 OR NN = 27 OR NN = 19 THEN ISR = ISR *2:ILR = ILR *2
3620 LR = RM *(RS +SL):SR = RM *RS
3630 AN = I *2 *PI/NS *DI
3640 IF NN = 9 OR NN = 27 OR NN = 19 THEN AN = AN -PI *DI/NS
3650 FOR J = 0 TO NA
3660 CA = COS(AN):SA = SIN(AN)
3670 HPLOT CX +SR *SA,CY -SR *CA TO CX +LR *SA,CY -LR *CA
3680 AN = AN +IA:LR = LR +ILR:SR = SR +ISR
3690 IF LR >RM +ILR/4 AND NA - INT(NA/2) *2 = 0 THEN ILR = -ILR:LR = LR +2 *ILR:ISR = -ISR:SR = SR +2 *ISR
3700 IF LR >RM +ILR/4 THEN ILR = -ILR:LR = LR +ILR:ISR = -ISR:SR = SR +ISR
3710 GOSUB 500
3720 NEXT J
3730 NEXT I
3740 RETURN
3750 REM ART FORMS 32,21,7
3760 IF RND(1) -.5 >0 THEN C = RND(1) *41 +30: GOTO 3780
3770 C = 100
3780 NS = INT( RND(1) *C/8 +4)
3790 P = INT( RND(1) *11 +5): GOTO 3830
3800 C = 200
3810 NS = INT(( RND(1) *C/8 +4)/2) *2
3820 P = INT(( RND(1) *11 +2)/2) *2 +1
3830 PR = RND(1) *.6 +.2
3840 GOTO 3890
3850 C = RND(1) *20 +40
3860 NS = INT( RND(1) *3 +3)
3870 P = INT( RND(1) *5 +5)
3880 PR = -1
3890 R = RM:IA = PI/P
3900 IF NS = 1 THEN IR = 0: GOTO 3920
3910 IR = C *R/(NS -1)/100
3920 FOR DE = 1 TO 200: GOSUB 500: NEXT DE
3930 GOSUB 950
3940 REM GRAPH ROUTINE
3950 FOR I = 1 TO NS
3960 IF I = NS AND NN = 32 GOTO 4040
3970 HPLOT CX,CY -R
3980 AN = 0:RR = R *PR
3990 FOR J = 1 TO P
4000 AN = AN +IA: HPLOT TO CX +RR * SIN(AN),CY -RR * COS(AN)
4010 AN = AN +IA: HPLOT TO CX +R * SIN(AN),CY -R * COS(AN)
4020 GOSUB 500: NEXT J
4030 R = R -IR
4040 NEXT I
4050 RETURN
4060 REM ART FORM 8
4070 N = INT( RND(1) *2 +2)
4080 HO = RND(1) *.8 +.2
4090 HI = RND(1) *HO +1 -HO
4100 IF RND(1) -.5 >0 THEN RO = 0:RI = 0: GOTO 4140
4110 RO = RND(1) *PI *3/18
4120 IF N = 2 THEN RI = 0: IF RND(1) -.5 >0 THEN RI = RO
4130 IF N = 3 THEN RI = RO/2
4140 P = INT( RND(1) *18 +12)
4150 S = INT(P *( RND(1) *.5 +.25))
4160 C = INT( RND(1) *2 +1)
4170 GOSUB 4670
4180 GOSUB 4770
4190 GOSUB 4880
4200 GOSUB 950
4210 REM GRAPH ROUTINE
4220 HPLOT P(1,1,1),P(1,1,2)
4230 I = 1:L = 1:J = 1
4240 FOR K = 1 TO P +1
4250 I = I +L: IF I >N +1 THEN L = -1:I = I -2
4260 J = J +S: IF J >P THEN J = J -P
4270 HPLOT TO P(I,J,1),P(I,J,2)
4280 GOSUB 500
4290 IF I < >1 GOTO 4250
4300 L = 1: NEXT K
4310 RETURN
4320 REM ART FORM 15
4330 N = 1
4340 HO = RND(1) *.5 +.5
4350 HI = RND(1) *(1 -HO) +HO
4360 RO = RND(1) *PI *1/9:RI = RO
4370 P = INT( RND(1) *18 +13)
4380 S = INT(P *( RND(1) *.25 +.25))
4390 C = INT( RND(1) *2 +1)
4400 GOSUB 4670
4410 GOSUB 4770
4420 P1 = P:S1 = S
4430 P = P1 +25
4440 S = INT(S1/P1 *P)
4450 GOSUB 4670
4460 GOSUB 4880
4470 GOSUB 950
4480 REM GRAPH ROUTINE
4490 J = 1
4500 HPLOT P(1,1,1),P(1,1,2)
4510 FOR K = 1 TO P1 +1
4520 J = J +S1: IF J >P1 THEN J = J -P1
4530 HPLOT TO P(2,J,1),P(2,J,2)
4540 J = J +S1: IF J >P1 THEN J = J -P1
4550 HPLOT TO P(1,J,1),P(1,J,2)
4560 NEXT K
4570 J = 1: HCOLOR= INT( RND(1) *2 +5)
4580 HPLOT P(3,1,1),P(3,1,2)
4590 FOR K = 1 TO P +1
4600 J = J +S: IF J >P THEN J = J -P
4610 HPLOT TO P(4,J,1),P(4,J,2)
4620 J = J +S: IF J >P THEN J = J -P
4630 HPLOT TO P(3,J,1),P(3,J,2)
4640 NEXT K
4650 RETURN
4660 REM INSURE THAT NO LINE DUPLICATION OCCURS
4670 I = 1:J = 1
4680 I = I +1
4690 FOR K = 1 TO 2 *N
4700 J = J +S: IF J >P THEN J = J -P
4710 NEXT K
4720 IF I <P AND J = 1 THEN P = P +1: GOTO 4670
4730 GOSUB 500
4740 IF I <P GOTO 4680
4750 RETURN
4760 REM DEFINE OUTSIDE HOOPS
4770 IF C = 1 THEN IX = 90:IY = 274:J = 1:K = 2:Y = CY
4780 IF C = 2 THEN IX = 130:IY = 186:J = 2:K = 1:Y = CX
4790 HO = HO *IX:RO = HO * SIN(RO):IX = 5 +RO:IY = IY -RO
4800 L = N +1:IA = 2 *PI/P
4810 FOR I = 1 TO P:AN = I *IA:SA = SIN(AN):CA = COS(AN)
4820 P(1,I,J) = IX +RO *CA:P(1,I,K) = Y +HO *SA
4830 P(L,I,J) = IY +RO *CA:P(L,I,K) = P(1,I,K)
4840 GOSUB 500
4850 NEXT I
4860 RETURN
4870 REM DEFINE INSIDE HOOP(S)
4880 PX = IY -IX:IA = 2 *PI/P
4890 IF C = 1 THEN IX = 90:IY = CX:J = 1:K = 2:Y = CY
4900 IF C = 2 THEN IX = 130:IY = CY:J = 2:K = 1:Y = CX
4910 HI = HI *IX:RI = HI * SIN(RI)
4920 IF N = 1 THEN PX = RND(1) *PX/6 +PX/6:IX = IY -PX:IY = IY +PX:L = 3:M = 4
4930 IF N = 2 THEN IX = IY:L = 2:M = 4
4940 IF N = 3 THEN PX = ( RND(1) *.8 -.4) *PX:IX = IY -PX:IY = IY +PX:L = 2:M = 3
4950 FOR I = 1 TO P:AN = I *IA:SA = SIN(AN):CA = COS(AN)
4960 P(L,I,J) = IX +RI *CA:P(L,I,K) = Y +HI *SA
4970 P(M,I,J) = IY +RI *CA:P(M,I,K) = P(L,I,K)
4980 GOSUB 500: NEXT I: RETURN
4990 REM ART FORM 1
5000 N = INT( RND(1) *4 +3)
5010 AN = PI/N
5020 R = ( RND(1) *.2 +.3) *RM:RR = 100
5030 M = INT( RND(1) *30/N +10)
5040 IY = R/M
5050 IX = (RR -R) * TAN(AN)/M
5060 REM DEFINE BASIC CURVE
5070 FOR I = 0 TO M:P(0,I,1) = 0:P(0,I,2) = I *IY: NEXT I
5080 P(2,0,1) = 0:P(2,0,2) = 0:P(2,1,1) = 0:P(2,1,2) = IY
5090 FOR I = 2 TO M +10
5100 B1 = (I -1) *IY
5110 B2 = I *IY
5120 M1 = (RR -B1)/((I -1) *IX)
5130 M2 = (RR -B2)/(I *IX)
5140 P(2,I,1) = (B2 -B1)/(M1 -M2)
5150 P(2,I,2) = P(2,I,1) *M1 +B1
5160 GOSUB 500
5170 NEXT I
5180 REM ROTATE AND TRANSLATE BASIC CURVE
5190 CA = COS(AN -PI):SA = SIN(AN -PI)
5200 FOR I = 0 TO M +10
5210 X = P(2,I,1) *CA -P(2,I,2) *SA
5220 Y = P(2,I,1) *SA +P(2,I,2) *CA +RM
5230 P(2,I,1) = X:P(2,I,2) = Y
5240 GOSUB 500
5250 NEXT I
5260 REM CALCULATE END POINTS
5270 P(1,0,1) = 0:P(1,0,2) = RM
5280 FOR I = 1 TO M
5290 B1 = I *IY:M1 = (RR -B1)/(I *IX)
5300 FOR J = 1 TO M +10
5310 IF P(2,J,1) = P(2,J -1,1) THEN M2 = 9999: GOTO 5330
5320 M2 = (P(2,J,2) -P(2,J -1,2))/(P(2,J,1) -P(2,J -1,1))
5330 X = (P(2,J -1,2) -P(2,J -1,1) *M2 -B1)/(M1 -M2)
5340 IF X <P(2,J -1,1) OR X > = P(2,J,1) GOTO 5380
5350 P(1,I,1) = X
5360 P(1,I,2) = M1 *X +B1
5370 GOTO 5390
5380 NEXT J
5390 GOSUB 500
5400 NEXT I
5410 GOSUB 950
5420 REM GRAPH ROUTINE
5430 FOR I = 0 TO N -1
5440 CA = COS(2 *I *AN):SA = SIN(2 *I *AN)
5450 X = 0:Y = 0
5460 GOSUB 5550
5470 NEXT I
5480 FOR I = 0 TO N -1
5490 CA = COS(2 *I *AN +AN +PI):SA = SIN(2 *I *AN +AN +PI)
5500 X = -RM * SIN(2 *I *AN +AN):Y = RM * COS(2 *I *AN +AN)
5510 GOSUB 5550
5520 NEXT I
5530 RETURN
5540 REM LINE ROTATE, TRANSLATE, AND PLOT ROUTINE
5550 HPLOT CX +X +P(1,0,1) *CA -P(1,0,2) *SA,CY -Y -P(1,0,1) *SA -P(1,0,2) *CA
5560 HPLOT TO CX +X +P(0,0,1) *CA -P(0,0,2) *SA,CY -Y -P(0,0,1) *SA -P(0,0,2) *CA
5570 FOR J = 1 TO M
5580 HPLOT CX +X +P(1,J,1) *CA -P(1,J,2) *SA,CY -Y -P(1,J,1) *SA -P(1,J,2) *CA
5590 HPLOT TO CX +X +P(0,J,1) *CA -P(0,J,2) *SA,CY -Y -P(0,J,1) *SA -P(0,J,2) *CA
5600 HPLOT TO CX +X -P(1,J,1) *CA -P(1,J,2) *SA,CY -Y +P(1,J,1) *SA -P(1,J,2) *CA
5610 GOSUB 500
5620 NEXT J
5630 RETURN